<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<jsp:useBean id="CR" class="com.fann.ClassRoom" scope="session"></jsp:useBean>

<%
String action = request.getParameter("acttype");
String nName;
if (action.equals("classRoomAdd")){
	CR.setId(0);
	CR.setCr_id("");
	CR.setCr_name("");
	CR.setCr_location("");
	CR.setCr_cost(0);
	nName = "新增";
} else {
	nName = "修改";
}
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title><%=nName %>教室</title>
</head>
<body>

<form action="ClassRoomController" method="post">
<br/>
<input type="hidden" id="acttype" name="acttype" value="<%=action %>" />
<input type="hidden" id="acttype" name="id" value="${CR.id }" />
<table align="center">
	<tr>
		<td align="right">教室編號:</td>
		<td><input type="text" id="cr_id" name="cr_id" value="${CR.cr_id }" />
			<img style="Display:none">
		</td>
	</tr>
	<tr>
		<td align="right">教室名稱:</td>
		<td>
			<input type="text" id="cr_name" name="cr_name" value="${CR.cr_name }" />
		</td>
	</tr>
	<tr>
		<td align="right">教室地點:</td>
		<td>
			<input type="text" id="cr_location" name="cr_location" value="${CR.cr_location }" />
		</td>
	</tr>
	<tr>
		<td align="right">教室費用:</td>
		<td>
			<input type="text" id="cr_cost" name="cr_cost" value="${CR.cr_cost }" />
		</td>
	</tr>
	<tr>
		<td align="center" colspan="2">
			<input type="submit" value="<%=nName %>教室"/>
		</td>
	</tr>
</table>
</form>

</body>
</html>